PROP_VERTICAL,
PROP_PACK_START,
+
+ N_PROPS
};
+static GParamSpec *props[N_PROPS] = { NULL, };
+
struct _StBoxLayoutPrivate
{
StAdjustment *hadjustment;
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
- GParamSpec *pspec;
object_class->get_property = st_box_layout_get_property;
object_class->set_property = st_box_layout_set_property;
* A convenience property for the #ClutterBoxLayout:vertical property of the
* internal layout for #StBoxLayout.
*/
- pspec = g_param_spec_boolean ("vertical",
- "Vertical",
- "Whether the layout should be vertical, rather"
- "than horizontal",
- FALSE,
- ST_PARAM_READWRITE);
- g_object_class_install_property (object_class, PROP_VERTICAL, pspec);
+ props[PROP_VERTICAL] =
+ g_param_spec_boolean ("vertical",
+ "Vertical",
+ "Whether the layout should be vertical, rather"
+ "than horizontal",
+ FALSE,
+ ST_PARAM_READWRITE);
/**
* StBoxLayout:pack-start:
* A convenience property for the #ClutterBoxLayout:pack-start property of the
* internal layout for #StBoxLayout.
*/
- pspec = g_param_spec_boolean ("pack-start",
- "Pack Start",
- "Whether to pack items at the start of the box",
- FALSE,
- ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
- g_object_class_install_property (object_class, PROP_PACK_START, pspec);
+ props[PROP_PACK_START] =
+ g_param_spec_boolean ("pack-start",
+ "Pack Start",
+ "Whether to pack items at the start of the box",
+ FALSE,
+ ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
+
+ g_object_class_install_properties (object_class, N_PROPS, props);
}
static void
if (clutter_box_layout_get_orientation (CLUTTER_BOX_LAYOUT (layout)) != orientation)
{
clutter_box_layout_set_orientation (CLUTTER_BOX_LAYOUT (layout), orientation);
- g_object_notify (G_OBJECT (box), "vertical");
+ g_object_notify_by_pspec (G_OBJECT (box), props[PROP_VERTICAL]);
}
}
enum
{
PROP_0,
- PROP_SCALE_FACTOR
+ PROP_SCALE_FACTOR,
+
+ N_PROPS
};
+static GParamSpec *props[N_PROPS] = { NULL, };
+
enum
{
CHANGED,
return;
context->scale_factor = scale_factor;
- g_object_notify (G_OBJECT (context), "scale-factor");
+ g_object_notify_by_pspec (G_OBJECT (context), props[PROP_SCALE_FACTOR]);
st_theme_context_changed (context);
}
*
* The scaling factor used for HiDPI scaling.
*/
- g_object_class_install_property (object_class,
- PROP_SCALE_FACTOR,
- g_param_spec_int ("scale-factor",
- "Scale factor",
- "Integer scale factor used for HiDPI scaling",
- 0, G_MAXINT, 1,
- ST_PARAM_READWRITE));
+ props[PROP_SCALE_FACTOR] =
+ g_param_spec_int ("scale-factor",
+ "Scale factor",
+ "Integer scale factor used for HiDPI scaling",
+ 0, G_MAXINT, 1,
+ ST_PARAM_READWRITE);
+
+ g_object_class_install_properties (object_class, N_PROPS, props);
/**
* StThemeContext::changed:
enum {
PROP_0,
+
PROP_CLIP_TO_VIEW,
+
+ N_PROPS,
+
+ /* StScrollable */
PROP_HADJUST,
PROP_VADJUST
};
+static GParamSpec *props[N_PROPS] = { NULL, };
+
typedef struct
{
StAdjustment *hadjustment;
{
priv->clip_to_view = clip_to_view;
clutter_actor_queue_redraw (CLUTTER_ACTOR (viewport));
+ g_object_notify_by_pspec (G_OBJECT (viewport), props[PROP_CLIP_TO_VIEW]);
}
}
actor_class->get_paint_volume = st_viewport_get_paint_volume;
actor_class->pick = st_viewport_pick;
- g_object_class_install_property (object_class,
- PROP_CLIP_TO_VIEW,
- g_param_spec_boolean ("clip-to-view",
- "Clip to view",
- "Clip to view",
- TRUE,
- ST_PARAM_READWRITE));
+ props[PROP_CLIP_TO_VIEW] =
+ g_param_spec_boolean ("clip-to-view",
+ "Clip to view",
+ "Clip to view",
+ TRUE,
+ ST_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/* StScrollable properties */
g_object_class_override_property (object_class,
g_object_class_override_property (object_class,
PROP_VADJUST,
"vadjustment");
+
+ g_object_class_install_properties (object_class, N_PROPS, props);
}
static void